package com.example.Web_chat.mapper;

import com.example.Web_chat.model.GroupChatMember;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface GroupChatMemberMapper {

    // 根据群聊ID获取所有成员
    List<GroupChatMember> findByGroupId(Integer groupId);

    // 添加成员到群聊
    void addMember(GroupChatMember groupChatMember);

    // 添加群聊用户
    GroupChatMember findByGroupIdAndUserId(@Param("groupId") int groupId, @Param("userId") int userId);
    // 删除群成员
    int deleteMember(@Param("groupId") Integer groupId, @Param("userId") Integer userId);

}
